/*!
 * Mixins
 */

// We just use the CSS3 mixins of Compass
@import 'compass/css3';


// Clearfix
@mixin clearfix {
  *zoom: 1;
  &:before, &:after {
    content: '\20';
    display: table;
  }
  &:after {
    clear: both;
  }
}


// ie7 inline-block hack
@mixin ie7-inline-block {
  *display: inline;
  *zoom: 1;
}


// Sizing shortcuts
@mixin size($width: 1px, $height: 1px, $radius: false) {
  width: $width;
  height: $height;
  @if type-of($radius) == number {
    border-radius: $radius;
  }
}
@mixin square($size: 1px, $radius: false) {
  @include size($size, $size, $radius);
}


// Set color for the placeholder text
@mixin placeholder($color: #999) {
  :-moz-placeholder {
    color: $color;
  }
  ::-webkit-input-placeholder {
    color: $color;
  }
}


// Set background-color for the selected text
@mixin selection($f-color: inherit, $b-color: #b4d5fe) {
  @each $prefix in '-moz-', '' {
    ::#{$prefix}selection {
      background-color: $b-color;
      color: $f-color;
      text-shadow: none;
    }
  }
}


// Set text-size-adjust property for mobile devices
@mixin text-size-adjust($value: 100%) {
  @each $prefix in 'webkit', 'moz', 'ms' {
    -#{$prefix}-text-size-adjust: $value;
  }
}
